<template>
	<div>
		<!-- 重置密码 -->
		<el-form :model="pwdForm" label-width="120px">
			<el-form-item label="新密码">
				<el-input class="w-ipt" v-model="pwdForm.new_password" @change="changeNewPwd"></el-input>
			</el-form-item>
			<el-form-item label="再次确认新密码">
				<el-input class="w-ipt" v-model="pwdForm.confirm_password"  @change="changeConfirmPwd"></el-input>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				// 重置密码
				pwdForm: {
					new_password: this.userInfo.new_password,
					confirm_password: this.userInfo.confirm_password,
					user_id: this.userInfo.id
				},
			}
		},
		props: ['userInfo'],
		watch: {
			userInfo(val) {
				this.user_id = val.user_id;
				this.new_password = val.new_password;
				this.confirm_password = val.confirm_password;
			}
		},
		methods: {
			changeNewPwd(val) {
				this.$emit('getChildNewPwd', {
					child_new_pwd: val
				})
			},
			changeConfirmPwd(val) {
				this.$emit('getChildConfirmPwd', {
					child_confirm_pwd: val
				})
			},
		}
	}
</script>

<style>
</style>
